﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace filesIO {
    
    public class FileReads {

       static public List<string> ReadFile(string filePath) {
           
          List<string> fileLines = new List<string>(); 
           
          if (File.Exists(filePath)) {
               using (StreamReader sr = new StreamReader(filePath)) {
                   string line;
                                       
                   while ((line = sr.ReadLine()) != null) {
                       fileLines.Add(line);
                   }
               }
           } else {
               throw new FileNotFoundException("File not found!", filePath);
           }
           
           return fileLines;
       }


    }
}
